console.log('1');

async function async1() {
    await async2();
    console.log('2');
    Promise.resolve(async2())
        .then(function () {
            console.log('2');
        })
        .then(function () {});
}

async function async2() {
    console.log('3');
}
async1();

setTimeout(function () {
    console.log('4');
}, 0);

new Promise((resolve) => {
    console.log('5');
    resolve();
})
    .then(function () {
        console.log('6');
    })
    .then(function () {
        console.log('7');
    });

console.log('8');
